package com.healthcare;

import java.io.IOException;
import java.io.PrintWriter;
import java.rmi.RemoteException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.mail.Message;
import javax.mail.Transport;
import javax.mail.internet.MimeMessage;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import webservices.HealthCareServerProxy;

/**
 * Servlet implementation class AddDoctorList
 */
public class DocUserList extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public DocUserList() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @return 
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		//String username1 = request.getParameter("data");
		//String docid = request.getSession().getAttribute("docid").toString();
	//String userid = null;
		// userid = (String) request.getSession().getAttribute("userids");
		
		// String docid = request.getSession().getAttribute("docid").toString();
	      //  String userid = null;
	               //  userid = (String) request.getSession().getAttribute("userids");
	                 String user = request.getAttribute("userid").toString();
	                 String username2 = request.getParameter("userValue");
	                 System.out.println("inside DocUserPostList doGet" + username2);
	              //  System.out.println("inside doGet" + userid);
	                request.setAttribute("userid", user);
	                RequestDispatcher dispatcher = request.getRequestDispatcher("/DocUserListPosts.jsp");
	                dispatcher.forward(request, response);
		//username2 = "";
		//userid= "";
		/*String[] userPostComment = null;
		HealthCareServerProxy proxy = new HealthCareServerProxy();
		
		String data = null;
		try {
			data = proxy.getDocUserPosts( username1,  docid);
			if(!data.isEmpty()){
				userPostComment = data.split("@");	
				System.out.println(userPostComment[0]);
				
			}
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return ; */
		
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
	
			
		
	}

}
